<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/css/all.min.css" integrity="sha256-mUZM63G8m73Mcidfrv5E+Y61y7a12O5mW4ezU3bxqW4=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"anynone.gitee.io","root":"/","images":"/images","scheme":"Pisces","darkmode":true,"version":"8.7.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>
<meta name="description" content="1. 安装中文输入法 打开设置，找到语言设置，将配置改为中文，安装好中文语言包，并应用到整个系统  打开设置，找到输入法配置，选择简体中文，安装语言包并将输入法框架改为fcitx  安装搜狗输入法下载地址： https:&#x2F;&#x2F;shurufa.sogou.com&#x2F;linux下载好deb文件，双击或者dpkg安装即可，之后重启  复制libfcitxplatforminputcontextplugin.">
<meta property="og:type" content="article">
<meta property="og:title" content="mint linux解决qtcreator无法输入中文问题">
<meta property="og:url" content="https://anynone.gitee.io/2022/09/30/linux-qt5-inputcontext/index.html">
<meta property="og:site_name" content="anynone">
<meta property="og:description" content="1. 安装中文输入法 打开设置，找到语言设置，将配置改为中文，安装好中文语言包，并应用到整个系统  打开设置，找到输入法配置，选择简体中文，安装语言包并将输入法框架改为fcitx  安装搜狗输入法下载地址： https:&#x2F;&#x2F;shurufa.sogou.com&#x2F;linux下载好deb文件，双击或者dpkg安装即可，之后重启  复制libfcitxplatforminputcontextplugin.">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/1.png">
<meta property="og:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/2.png">
<meta property="og:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/5.png">
<meta property="og:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/3.png">
<meta property="og:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/4.png">
<meta property="og:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/6.png">
<meta property="article:published_time" content="2022-09-30T14:21:37.000Z">
<meta property="article:modified_time" content="2022-10-08T11:51:31.042Z">
<meta property="article:author" content="山丘之王">
<meta property="article:tag" content="qtcreator,mint,输入中文">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://anynone.gitee.io/images/qt-creator-inputcontext/1.png">


<link rel="canonical" href="https://anynone.gitee.io/2022/09/30/linux-qt5-inputcontext/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://anynone.gitee.io/2022/09/30/linux-qt5-inputcontext/","path":"2022/09/30/linux-qt5-inputcontext/","title":"mint linux解决qtcreator无法输入中文问题"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>mint linux解决qtcreator无法输入中文问题 | anynone</title>
  




  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">anynone</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu">
        <li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
  </ul>
</nav>




</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <img src="/images/head.jpg">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-5"><a class="nav-link" href="#1-%E5%AE%89%E8%A3%85%E4%B8%AD%E6%96%87%E8%BE%93%E5%85%A5%E6%B3%95"><span class="nav-number">1.</span> <span class="nav-text">1. 安装中文输入法</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#2-%E7%BC%96%E8%AF%91fcitx-qt5"><span class="nav-number">2.</span> <span class="nav-text">2. 编译fcitx-qt5</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E5%A4%8D%E5%88%B6%E7%BC%96%E8%AF%91%E5%A5%BD%E7%9A%84so%E6%96%87%E4%BB%B6%E5%88%B0qtcreator%E6%8F%92%E4%BB%B6%E7%9B%AE%E5%BD%95%E5%B9%B6%E9%87%8D%E5%90%AFqtcreator%EF%BC%8C%E5%B0%B1%E5%83%8F%E7%AC%AC%E4%B8%80%E6%AD%A5%E7%9A%84%E6%97%B6%E5%80%99%E9%82%A3%E6%A0%B7"><span class="nav-number">3.</span> <span class="nav-text">复制编译好的so文件到qtcreator插件目录并重启qtcreator，就像第一步的时候那样</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#3-%E5%A5%BD%E4%BA%86%EF%BC%8C%E4%B8%80%E5%88%87%E5%87%86%E5%A4%87%E5%B0%B1%E7%BB%AA"><span class="nav-number">4.</span> <span class="nav-text">3. 好了，一切准备就绪</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">山丘之王</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">22</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">15</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/anynone" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;anynone" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
  </div>



        </div>
      </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="back-to-top" role="button" aria-label="返回顶部">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://anynone.gitee.io/2022/09/30/linux-qt5-inputcontext/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="山丘之王">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="anynone">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          mint linux解决qtcreator无法输入中文问题
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-09-30 22:21:37" itemprop="dateCreated datePublished" datetime="2022-09-30T22:21:37+08:00">2022-09-30</time>
    </span>
      <span class="post-meta-item">
        <span class="post-meta-item-icon">
          <i class="far fa-calendar-check"></i>
        </span>
        <span class="post-meta-item-text">更新于</span>
        <time title="修改时间：2022-10-08 19:51:31" itemprop="dateModified" datetime="2022-10-08T19:51:31+08:00">2022-10-08</time>
      </span>

  
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h5 id="1-安装中文输入法"><a href="#1-安装中文输入法" class="headerlink" title="1. 安装中文输入法"></a>1. 安装中文输入法</h5><ul>
<li><p>打开设置，找到语言设置，将配置改为中文，安装好中文语言包，并应用到整个系统</p>
<img src="/images/qt-creator-inputcontext/1.png" alt="1" style="zoom:80%;" /></li>
<li><p>打开设置，找到输入法配置，选择简体中文，安装语言包并将输入法框架改为fcitx</p>
<img src="/images/qt-creator-inputcontext/2.png" alt="2" style="zoom:80%;" /></li>
<li><p>安装搜狗输入法<br>下载地址： <a target="_blank" rel="noopener" href="https://shurufa.sogou.com/linux">https://shurufa.sogou.com/linux</a><br>下载好deb文件，双击或者dpkg安装即可，之后重启</p>
</li>
<li><p>复制libfcitxplatforminputcontextplugin.so到qtcreator安装目录插件文件夹(我的qt版本是5.14.2)</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 安装fcitx-frontend-qt5</span></span><br><span class="line">sudo apt-get install fcitx-frontend-qt5</span><br><span class="line"><span class="comment"># 复制so文件到qtcreator插件目录</span></span><br><span class="line">cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so [Qt安装目录]/5.14.2/gcc_64/plugins/platforminputcontexts/</span><br><span class="line">cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so [Qt安装目录]/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/</span><br></pre></td></tr></table></figure></li>
<li><p>重启qtcreator，尝试输入中文</p>
</li>
</ul>
<h5 id="2-编译fcitx-qt5"><a href="#2-编译fcitx-qt5" class="headerlink" title="2. 编译fcitx-qt5"></a>2. 编译fcitx-qt5</h5><p>如果经过第一步可以输入中文，恭喜你，你很幸运。但是，大多数情况是还是无法输入中文。因为高版本qtcreator无法识别系统更新源中提供的低版本libfcitxplatforminputcontextplugin.so。这个时候需要自己编译fcitx-qt5.</p>
<ul>
<li>首先看下编译qtcreator的qt版本，我这里有qt5和qt6两个版本编译的qtcreator，所以，两个版本我都编译。cmake和gcc我使用qt6包里的，其实版本不要太低就行<img src="/images/qt-creator-inputcontext/5.png" alt="5" style="zoom:75%;margin-left:0px;" /></li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">## 克隆最新代码</span></span><br><span class="line">git <span class="built_in">clone</span> https://github.com/fcitx/fcitx-qt5.git</span><br><span class="line"><span class="comment">## 安装好gcc, g++,make, cmake 以备不时之需</span></span><br><span class="line">sudo apt-get install gcc g++ make cmake</span><br><span class="line"><span class="comment">## 把qtcreator gcc加入到PATH,具体到qtcreator安装目录找</span></span><br><span class="line"><span class="built_in">export</span> PATH=/home/mick/ide/qtcreator/6.3.2/gcc_64/bin/:<span class="variable">$PATH</span></span><br><span class="line"><span class="built_in">export</span> PATH=/home/mick/ide/qtcreator/Tools/CMake/bin:<span class="variable">$PATH</span></span><br><span class="line"><span class="comment">## 进入fcitx-qt5项目目录，新建build文件夹开始编译</span></span><br><span class="line">mkdir build &amp;&amp; <span class="built_in">cd</span> build</span><br><span class="line"><span class="comment">### -DQt6_DIR QT6 cmakelist文件夹， -DQt5_DIR QT5 cmakelist文件夹</span></span><br><span class="line">cmake -DENABLE_LIBRARY=<span class="literal">false</span> -DQt6_DIR=/home/mick/ide/qtcreator/6.3.2/gcc_64/lib/cmake/Qt6/ -DQt5_DIR=/home/mick/ide/qtcreator/5.15.2/gcc_64/lib/cmake/Qt5 ../</span><br></pre></td></tr></table></figure>

<img style="margin-left:0px;" src="/images/qt-creator-inputcontext/3.png" alt="3" style="zoom:100%;" />

<h5 id="复制编译好的so文件到qtcreator插件目录并重启qtcreator，就像第一步的时候那样"><a href="#复制编译好的so文件到qtcreator插件目录并重启qtcreator，就像第一步的时候那样" class="headerlink" title="复制编译好的so文件到qtcreator插件目录并重启qtcreator，就像第一步的时候那样"></a>复制编译好的so文件到qtcreator插件目录并重启qtcreator，就像第一步的时候那样</h5><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 复制so文件到qtcreator插件目录</span></span><br><span class="line">cp ./qt5/platforminputcontext/libfcitxplatforminputcontextplugin.so [Qt安装目录]/5.14.2/gcc_64/plugins/platforminputcontexts/</span><br><span class="line">cp ./qt5/platforminputcontext/libfcitxplatforminputcontextplugin.so [Qt安装目录]/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/</span><br><span class="line"><span class="comment">## 还有qt6编译的qtcreator</span></span><br><span class="line">cp libfcitxplatforminputcontextplugin-qt6.so [Qt安装目录]/6.3.2/gcc_64/plugins/platforminputcontexts/</span><br><span class="line">cp libfcitxplatforminputcontextplugin-qt6.so [Qt安装目录]/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/</span><br></pre></td></tr></table></figure>

<h5 id="3-好了，一切准备就绪"><a href="#3-好了，一切准备就绪" class="headerlink" title="3. 好了，一切准备就绪"></a>3. 好了，一切准备就绪</h5><img style="margin-left:0px;" src="/images/qt-creator-inputcontext/4.png" alt="3" style="zoom:100%;" />

<img src="/images/qt-creator-inputcontext/6.png" style="zoom:80%;margin-left:0px;" />

    </div>

    
    
    

    <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/qtcreator-mint-%E8%BE%93%E5%85%A5%E4%B8%AD%E6%96%87/" rel="tag"># qtcreator,mint,输入中文</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2022/09/29/20220420-gdb/" rel="prev" title="gdb常用操作">
                  <i class="fa fa-chevron-left"></i> gdb常用操作
                </a>
            </div>
            <div class="post-nav-item">
            </div>
          </div>
    </footer>
  </article>
</div>






</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 2021 – 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">山丘之王</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/pisces/" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>

  





  





</body>
</html>
